//
//  CDMainViewController.swift
//  chendong微博
//
//  Created by chen dong on 2021/3/16.
//

import UIKit

class CDMainViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        view.backgroundColor = UIColor.red
        
        
    }
    
//    private lazy var customBtn:UIButton
    
    //MARK: - 监听方法
//    private 保证方法私有 ，仅在当前对象被访问
//    @objc 允许这个函数在‘运行时’通过OC的消息机制调用
    func composeStatus() {
        print("aaaaa")
    }
    
    
    
    //使用代码控制设备方向
    dynamic func supportedinterfaceOrientations() -> UIInterfaceOrientationMask{
        
        return .portrait
    }
    
   
}

extension CDMainViewController {
    
    private func setUpChildControllers(){
        //设置所有子控制器
    
        
    }
    
    private func controller(dict : [String:String]) -> UIViewController {
        
        guard let clsName = dict["clsName"],
              let title = dict["title"],
              let imageName = dict["imagename"]
              else {
            return UIViewController()
        }
        //创建视图控制器
        //
        
//        let vc = NSClassFromString(Bundle.main)
        
//        let vc =
        
        let array:[String:String] = ["student":"","name":""]
        
        //数组->json序列
        let data = try!JSONSerialization.data(withJSONObject: array, options: [])
        (data as NSData).write(toFile: "", atomically: true)
        
        
        
        
        return UIViewController()
    }
    
    
    
}













